package com.ynkbny.web.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ynkbny.base.PageResult;
import com.ynkbny.domain.SystemLog;
import com.ynkbny.service.SystemLogService;
import com.ynkbny.util.Res;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author YY
 * @Date 2023/8/17 10:48
 */
@Slf4j
@Api(tags = "数据上报日志")
@RestController
@RequestMapping("/system")
public class    SystemLogController {

    @Resource
    private SystemLogService systemLogService;

    /**
     * 上报数据日志 分页查询
     *
     * @Author YY
     * @param pageNum       页码
     * @param pageSize      单页数量
     * @param condition 查询条件 [{"column":"remark4","type":"eq","value":"226912"}]
     * @return 分页数据
     */
    @ApiOperation("查询分页数据")
    @GetMapping("/pageList")
    public Res<PageResult<SystemLog>> getSystemLog(Long pageNum,Long pageSize,String condition) {
        Page<SystemLog> pageModel = systemLogService.selectByPage(pageNum, pageSize, condition);
        PageResult<SystemLog> dtoPageResult = new PageResult<>(pageModel);
        return Res.ok(dtoPageResult);
    }
}
